import { Module } from '@nestjs/common';
import { ProxyController } from './proxy.controller';
import { ProxyService } from './proxy.service';
import { CacheModule } from '@nestjs/cache-manager';
import { EventEmitterModule } from '@nestjs/event-emitter';
import { EventEmitterService } from './event-emitter.service';

@Module({
  imports: [
    CacheModule.register({
      isGlobal: true,
      ttl: 5 * 60 * 1000, // 5 minutes
    }),
    EventEmitterModule.forRoot({
      wildcard: true,
      delimiter: ':',
      maxListeners: 20,
    }),
    ProxyModule,
  ],
  controllers: [ProxyController],
  providers: [ProxyService, EventEmitterService],
  exports: [EventEmitterService],
})
export class ProxyModule {}
